/**
 * Copyright (C), 2015-2018, XXX有限公司
 * FileName: ArticleService
 * Author:   臧浩鹏
 * Date:     2018/8/4 10:33
 * Description: 测试接口
 * History:
 * <author>          <time>          <version>          <desc>
 * 作者姓名           修改时间           版本号              描述
 */
package com.play.service;

import com.play.mapper.ArticleMapper;
import com.play.model.Article;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

/**
 * 〈一句话功能简述〉<br> 
 * 〈测试接口〉
 *
 * @author 臧浩鹏
 * @create 2018/8/4
 * @since 1.0.0
 */
@Service
public class ArticleService implements IArticleService {

    @Autowired
    private ArticleMapper articleMapper;

    @Override
    public Integer insertArticleByAIdAndUId(Article article, Integer uid) {
        article.setAuid(uid);
        Integer res = articleMapper.insertArticle(article);
        if(res>0) {
            return article.getAid();
        }
        return 0;
    }

    @Override
    public Article selectByAId(Integer aid) {

       Article article = articleMapper.selectByAid(aid);

       return article;
    }
}
